/**
 * Created by xukj on 2018/6/4.
 */

import React from 'react';
import {
  View,
  Text,
  Image,
  TouchableOpacity,
  StyleSheet,
} from 'react-native';
import Colors from '../constants/Colors';

const CustomCellItem01 = ({data, onPress}) => (
  <TouchableOpacity onPress={() => onPress(data)}>
    <View style={styles.containerStyle}>
      <Image style={styles.imageStyle}/>
      <View style={styles.textContainerStyle}>
        <Text style={{fontSize: 16, fontWeight: 'bold'}} numberOfLines={2}>{data.title}</Text>
        <Text style={{fontSize: 14, color: Colors.gray06, marginTop: 8, lineHeight: 18}} numberOfLines={3}>{data.content}</Text>
      </View>
    </View>
  </TouchableOpacity>
);

const styles = StyleSheet.create({
  containerStyle: {
    flex: 1,
    flexDirection: 'row',
    backgroundColor: 'white',
    alignItems: 'center',
    paddingLeft: 14,
    height: 110,
  },
  textContainerStyle: {
    flex: 1,
    flexDirection: 'column',
    justifyContent: 'flex-start',
    alignItems: 'flex-start',
    padding: 14,
    height: 110,
  },
  imageStyle: {
    width: 120,
    height: 90,
    borderRadius: 4,
    backgroundColor: Colors.gray04,
  },
  textStyle: {

  }
});

export default CustomCellItem01;